#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
int main()
{
    int m = 0;
    int n = 0;
    int p = 0;
    int q = 0;
    scanf("%d%d%d%d", &m, &n, &p, &q);
    double score = 0.2 * m + 0.1 * n + 0.2 * p + 0.5 * q;
    printf("%.1f\n", score);

    return 0;
}